package corej.course.collection.list.linkedlist;

import java.util.LinkedList;

public class TestMyStack {

    public static void main(String[] args) {

        MyStack ms = new MyStack();
        ms.push("Liucy");
        ms.push("George");
        ms.push("Huxz");

        System.out.println(ms.pop());
        System.out.println(ms.pop());
        System.out.println(ms.pop());
    }
}

class MyStack {
    private LinkedList list = new LinkedList();

    @SuppressWarnings("unchecked")
    public void push(Object o) {
        list.addFirst(o);
    }

    public Object pop() {
        return list.removeFirst();
    }
}